记一次CentOS 8 部署packstack部署OpenStack失败案例,请直接看最后

您所在的位置:网站首页 centos8 stream 安装 记一次CentOS 8 部署packstack部署OpenStack失败案例,请直接看最后

记一次CentOS 8 部署packstack部署OpenStack失败案例,请直接看最后

2023-04-02 21:35| 来源: 网络整理| 查看: 265

首先你需要一台安装好CentOS8 的虚拟机,相关参数如图。两块网卡,网卡1 NAT IP 192.168.100.100 GW=192.168.100.2 网卡2 可不做配置。能ping通百度。创建完成虚拟机记得打好快照。

开机编辑基本配置环境变量 [root@localhost ~]# nmcli connection show NAME UUID TYPE DEVICE ens33 02b0b195-3657-4ea3-81a7-cdfcbac06a81 ethernet ens33 ens34 42df5190-f1c7-4f3c-8a26-a2d6db51737d ethernet – [root@localhost ~]# nmcli connection modify ens33 ipv4.addresses 192.168.100.100/24 ipv4.gateway 192.168.100.2 ipv4.dns 114.114.114.114 ipv4.method manual [root@localhost ~]# nmcli connection reload ens33 && nmcli connection up ens33 && nmcli connection up ens33 连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/6) 连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/7)

遇到如下报错,原因在2022年1月31日,CentOS团队终于从官方镜像中移除CentOS 8的所有包。CentOS 8已于2021年12月31日寿终正寝,但软件包仍在官方镜像上保留了一段时间。现在他们被转移到https://vault.centos.org

[root@localhost ~]# sudo dnf update -y CentOS Linux 8 - AppStream 56 B/s | 38 B 00:00 错误:为 repo ‘appstream’ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

解决方法: 如果你仍然需要运行CentOS 8,你可以在/etc/yum.repos.d中更新一下源。使用vault.centos.org代替mirror.centos.org。

[root@localhost ~]# sudo sed -i -e “s|mirrorlist=|#mirrorlist=|g” /etc/yum.repos.d/CentOS-* [root@localhost ~]# sudo sed -i -e “s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g” /etc/yum.repos.d/CentOS-*

网络脚本已弃用,默认情况下不安装,因此需要显式安装,如果不安装重启虚拟机network 将不可用。 sudo dnf install network-scripts -y

禁用防火墙和网络管理器 sudo systemctl disable firewalld sudo systemctl stop firewalld sudo systemctl disable NetworkManager sudo systemctl stop NetworkManager sudo systemctl enable network sudo systemctl start network sudo setenforce 0 sudo sed -i ‘s/^SELINUX=.*/SELINUX=permissive/g’ /etc/selinux/config

遇到问题 Failed to set locale, defaulting to C.UTF-8 [root@localhost ~]# cat /etc/environment LANG=en_US.utf-8 LLC_ALL=en_US.utf-8

[root@localhost ~]# sudo dnf config-manager --enable powertools Failed to set locale, defaulting to C.UTF-8

[root@localhost ~]# locale -a locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_COLLATE to default locale: No such file or directory C C.utf8 POSIX zh_CN zh_CN.gb18030 zh_CN.gbk zh_CN.utf8 zh_HK zh_HK.utf8 zh_SG zh_SG.gbk zh_SG.utf8 zh_TW zh_TW.euctw zh_TW.utf8

[root@localhost ~]# dnf install langpacks-en glibc-all-langpacks -y Last metadata expiration check: 0:00:31 ago on Sat 25 Mar 2023 10:49:10 AM EDT. Package langpacks-en-1.0-12.el8.noarch is already installed. Package glibc-all-langpacks-2.28-164.el8.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete!

CentOS 8中执行命令,出现报错:Failed to set locale, defaulting to C.UTF-8 报错原因: 1、没有安装相应的语言包。 2、没有设置正确的语言环境。

解决方法1:安装语言包 设置语言环境需使用命令 locale locale -a 命令,查看目前系统已安装的语言包 安装中文语言包,命令yum install glibc-langpack-zh 安装英文语言包,命令 dnf install glibc-langpack-en 或 dnf install langpacks-en glibc-all-langpacks -y

解决方法2:设置正确的语言环境 echo “export LC_ALL=en_US.UTF-8” >> /etc/profile source /etc/profile 或使用命令locale -gen en_US.UTF-8

发现错误 No match for argument: centos-release-openstack-yoga

[root@localhost ~]# sudo dnf config-manager --enable powertools [root@localhost ~]# sudo dnf install -y centos-release-openstack-yoga CentOS Linux 8 - PowerTools 6.2 kB/s | 4.3 kB 00:00 No match for argument: centos-release-openstack-yoga Error: Unable to find a match: centos-release-openstack-yoga

[root@localhost ~]# cat /etc/redhat-release CentOS Linux release 8.5.2111

[root@localhost ~]# dnf --disablerepo ‘*’ --enablerepo extras swap centos-linux-repos centos-stream-repos Last metadata expiration check: 1:41:22 ago on Sat 25 Mar 2023 09:19:08 AM EDT. Dependencies resolved.

Package Architecture Version Repository Size

Installing: centos-stream-repos noarch 8-3.el8 extras 19 k Removing: centos-linux-repos noarch 8-3.el8 @baseos 26 k

Transaction Summary Install 1 Package Remove 1 Package

Total download size: 19 k Is this ok [y/N]: y Is this ok [y/N]: y Downloading Packages: centos-stream-repo 0% [ ] — B/s | 0 B --:-- ETA centos-stream-repo 0% [ ] — B/s | 0 B --:-- ETA centos-stream-repos-8-3.el8.noarch.rpm 1.2 kB/s | 19 kB 00:16

Total 1.2 kB/s | 19 kB 00:16 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : centos-stream-repos-8-3.el8.noarch 1/2 Erasing : centos-linux-repos-8-3.el8.noarch 2/2 warning: /etc/yum.repos.d/CentOS-Linux-PowerTools.repo saved as /etc/yum.repos.d/CentOS-Linux-PowerTools.repo.rpmsave warning: /etc/yum.repos.d/CentOS-Linux-Plus.repo saved as /etc/yum.repos.d/CentOS-Linux-Plus.repo.rpmsave warning: /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo saved as /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo.rpmsave warning: /etc/yum.repos.d/CentOS-Linux-FastTrack.repo saved as /etc/yum.repos.d/CentOS-Linux-FastTrack.repo.rpmsave warning: /etc/yum.repos.d/CentOS-Linux-Extras.repo saved as /etc/yum.repos.d/CentOS-Linux-Extras.repo.rpmsave warning: /etc/yum.repos.d/CentOS-Linux-Devel.repo saved as /etc/yum.repos.d/CentOS-Linux-Devel.repo.rpmsave warning: /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo saved as /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo.rpmsave warning: /etc/yum.repos.d/CentOS-Linux-BaseOS.repo saved as /etc/yum.repos.d/CentOS-Linux-BaseOS.repo.rpmsave warning: /etc/yum.repos.d/CentOS-Linux-AppStream.repo saved as /etc/yum.repos.d/CentOS-Linux-AppStream.repo.rpmsave

Verifying : centos-stream-repos-8-3.el8.noarch 1/2 Verifying : centos-linux-repos-8-3.el8.noarch 2/2

Installed: centos-stream-repos-8-3.el8.noarch Removed: centos-linux-repos-8-3.el8.noarch

Complete!

[root@localhost ~]# dnf distro-sync

shadow-utils-subid-2:4.6-17.el8.x86_64

Complete!

[root@localhost ~]# cat /etc/redhat-release CentOS Stream release 8 [root@localhost ~]# reboot

友情提示:Centos 8 Stream 官方支持到2024年5月31日,请小伙伴们注意哦!

重启过程中可能job is runing for Flush Journal to Persistent Storage (1min 22s A start1min 30s) ,这里只能等,时间到了会正常开机的。

正常安装 [root@localhost ~]# sudo dnf install -y centos-release-openstack-yoga CentOS Stream 8 - Extras common packages 646 B/s | 5.3 kB 00:08 Dependencies resolved. =========================================================================== Package Arch Version Repository Size =========================================================================== Installing: centos-release-openstack-yoga noarch 1-1.el8s extras-common 8.9 k Installing dependencies: centos-release-advanced-virtualization noarch 1.0-4.el8 extras 16 k centos-release-ceph-pacific noarch 1.0-2.el8 extras 8.9 k centos-release-messaging noarch 1-3.el8 extras 9.5 k centos-release-nfv-common noarch 1-3.el8 extras 9.3 k centos-release-nfv-openvswitch noarch 1-3.el8 extras 8.6 k centos-release-rabbitmq-38 noarch 1-3.el8 extras 8.4 k centos-release-storage-common noarch 2-2.el8 extras 9.4 k centos-release-virt-common noarch 1-2.el8 extras 8.9 k

Transaction Summary

Install 9 Packages

Total download size: 88 k Installed size: 32 k Downloading Packages: 184% [===============================] 1.5 kB/s | 1.3 kB (1/9): centos-release-ceph-pacific-1.0-2.e 1.7 kB/s | 8.9 kB 00:05 (2/9): centos-release-messaging-1-3.el8.no 1.8 kB/s | 9.5 kB 00:05 (3/9): centos-release-advanced-virtualizat 3.0 kB/s | 16 kB 00:05 (4/9): centos-release-nfv-common-1-3.el8.n 57 kB/s | 9.3 kB 00:00 (5/9): centos-release-nfv-openvswitch-1-3. 45 kB/s | 8.6 kB 00:00 (6/9): centos-release-rabbitmq-38-1-3.el8. 39 kB/s | 8.4 kB 00:00 (7/9): centos-release-storage-common-2-2.e 48 kB/s | 9.4 kB 00:00 (8/9): centos-release-virt-common-1-2.el8. 55 kB/s | 8.9 kB 00:00 (9/9): centos-release-openstack-yoga-1-1.e 870 B/s | 8.9 kB 00:10

Total 4.7 kB/s | 88 kB 00:18 CentOS Stream 8 - Extras common packages 2.1 MB/s | 2.1 kB 00:00 Importing GPG key 0x1D997668: Userid : “CentOS Extras SIG (https://wiki.centos.org/SpecialInterestGroup) [email protected]” Fingerprint: 363F C097 2F64 B699 AED3 968E 1FF6 A217 1D99 7668 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : centos-release-virt-common-1-2.el8.noarch 1/9 Installing : centos-release-advanced-virtualization-1.0-4.el 2/9 Running scriptlet: centos-release-advanced-virtualization-1.0-4.el 2/9 Installing : centos-release-storage-common-2-2.el8.noarch 3/9 Installing : centos-release-ceph-pacific-1.0-2.el8.noarch 4/9 Running scriptlet: centos-release-ceph-pacific-1.0-2.el8.noarch 4/9 Installing : centos-release-nfv-common-1-3.el8.noarch 5/9 Running scriptlet: centos-release-nfv-common-1-3.el8.noarch 5/9 Installing : centos-release-nfv-openvswitch-1-3.el8.noarch 6/9 Installing : centos-release-messaging-1-3.el8.noarch 7/9 Installing : centos-release-rabbitmq-38-1-3.el8.noarch 8/9 Installing : centos-release-openstack-yoga-1-1.el8s.noarch 9/9 Verifying : centos-release-advanced-virtualization-1.0-4.el 1/9 Verifying : centos-release-ceph-pacific-1.0-2.el8.noarch 2/9 Verifying : centos-release-messaging-1-3.el8.noarch 3/9 Verifying : centos-release-nfv-common-1-3.el8.noarch 4/9 Verifying : centos-release-nfv-openvswitch-1-3.el8.noarch 5/9 Verifying : centos-release-rabbitmq-38-1-3.el8.noarch 6/9 Verifying : centos-release-storage-common-2-2.el8.noarch 7/9 Verifying : centos-release-virt-common-1-2.el8.noarch 8/9 Verifying : centos-release-openstack-yoga-1-1.el8s.noarch 9/9

Installed: centos-release-advanced-virtualization-1.0-4.el8.noarch centos-release-ceph-pacific-1.0-2.el8.noarch centos-release-messaging-1-3.el8.noarch centos-release-nfv-common-1-3.el8.noarch centos-release-nfv-openvswitch-1-3.el8.noarch centos-release-openstack-yoga-1-1.el8s.noarch centos-release-rabbitmq-38-1-3.el8.noarch centos-release-storage-common-2-2.el8.noarch centos-release-virt-common-1-2.el8.noarch

Complete! [root@localhost ~]#

[root@localhost ~]# sudo dnf install -y openstack-packstack Last metadata expiration check: 0:00:37 ago on Sat 25 Mar 2023 11:22:52 AM EDT. Package openstack-packstack-1:20.0.0-1.el8.noarch is already installed. Dependencies resolved. Nothing to do. Complete!

修改主机名和/etc/hosts配置文件,对于具有默认选项的简单单节点 OpenStack 部署,请运行以下命令: [root@localhost ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.100.100 controller

[root@localhost ~]# [root@localhost ~]# hostnamectl set-hostname controller [root@localhost ~]# bash

[root@controller ~]# sudo packstack --allinone Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20230325-112822-ddmkvwox/openstack-setup.log

Installing: Clean Up [ DONE ] Discovering ip protocol version [ DONE ] Setting up ssh keys [ DONE ] Preparing servers [ DONE ] Pre installing Puppet and discovering hosts’ details [ DONE ] Preparing pre-install entries [ DONE ] Setting up CACERT [ DONE ] Preparing AMQP entries [ DONE ] Preparing MariaDB entries [ DONE ] Fixing Keystone LDAP config parameters to be undef if empty[ DONE ] Preparing Keystone entries [ DONE ] Preparing Glance entries [ DONE ] Checking if the Cinder server has a cinder-volumes vg[ DONE ] Preparing Cinder entries [ DONE ] Preparing Nova API entries [ DONE ] Creating ssh keys for Nova migration [ DONE ] Gathering ssh host keys for Nova migration [ DONE ] Preparing Nova Compute entries [ DONE ] Preparing Nova Scheduler entries [ DONE ] Preparing Nova VNC Proxy entries [ DONE ] Preparing OpenStack Network-related Nova entries [ DONE ] Preparing Nova Common entries [ DONE ] Preparing Neutron API entries [ DONE ] Preparing Neutron L3 entries [ DONE ] Preparing Neutron L2 Agent entries [ DONE ] Preparing Neutron DHCP Agent entries [ DONE ] Preparing Neutron Metering Agent entries [ DONE ] Checking if NetworkManager is enabled and running [ DONE ] Preparing OpenStack Client entries [ DONE ] Preparing Horizon entries [ DONE ] Preparing Swift builder entries [ DONE ] Preparing Swift proxy entries [ DONE ] Preparing Swift storage entries [ DONE ] Preparing Gnocchi entries [ DONE ] Preparing Redis entries [ DONE ] Preparing Ceilometer entries [ DONE ] Preparing Aodh entries [ DONE ] Preparing Puppet manifests [ DONE ] Copying Puppet modules and manifests [ DONE ] Applying 192.168.100.100_controller.pp Testing if puppet apply is finished: 192.168.100.100_controller.pp [ | ]

**

最后到这里卡住了,发现是源更新太多了导致失败,所以建议部署的时候直接找CentOS 8 Steam的镜像系统。

**



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3